package com.wyh.blog.utils;

import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;
import java.util.UUID;

public class Md5Util {
    public static boolean verify(String password, String password2){
        String salt = password2.substring(0,32);
        String s = DigestUtils.md5DigestAsHex((salt + password).getBytes(StandardCharsets.UTF_8));
        return (salt+s).equals(password2);
    }

//    public static void main(String[] args) {
//        System.out.println(Md5Util.verify("123456", "e2377426880545d287b97ee294fc30ea6d6f289424b95a2b2d7f8971216e39b7"));
//    }
}
